execute store result score #index temp run data get entity @s item.components."minecraft:custom_data".hubMenu.index
execute store result entity @s item.components."minecraft:custom_data".hubMenu.index int 1 run scoreboard players remove #index temp 1

#test是否存在元素
execute store result score #success temp run function vs:system/hub/menu/gamerule_settings/test/index_exist with entity @s item.components."minecraft:custom_data".hubMenu

execute if score #success temp matches 1 run function vs:system/hub/menu/gamerule_settings/read with entity @s item.components."minecraft:custom_data".hubMenu
execute if score #success temp matches 0 store result score #indexs temp run data get storage vs:system gamerules
execute if score #success temp matches 0 store result storage vs:system temp.index int 1 run scoreboard players remove #indexs temp 1
execute if score #success temp matches 0 run function vs:system/hub/menu/gamerule_settings/read with storage vs:system temp


scoreboard players reset #index temp
scoreboard players reset #indexs temp
scoreboard players reset #success temp
data remove storage vs:system temp.index


playsound block.dispenser.fail master @p[tag=inconfig] ~ ~ ~ 1.0